<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>个人信息练习</title>
</head>
<body>
<div>
    <table border="1">
        <caption>个人信息</caption>
        <tr>
            <td>照片:</td>
            <td><img :src="person.imgUrl" width="50px" alt=""></td>
        </tr>
        <tr>
            <td>名字:</td>
            <td>{{person.name}}</td>
        </tr>
        <tr>
            <td>年龄:</td>
            <td>{{person.age}}</td>
        </tr>
        <tr>
            <td>好友:</td>
            <td>
                <ul>
                    <li v-for="name in person.friend">{{name}}</li>
                </ul>
            </td>
        </tr>
    </table>
    <input type="button" value="请示数据" @click="f()">
</div>
<script src="../js/vue.js"></script>
<script>
let v = new Vue({
    el:"div",
    data:{
        person:{name:"xxx",age:"xxx",imgUrl:"../day05/head.jpg",friend:["xxx","xxx"]}
    },
    methods:{
        f(){
            let person = {name:"周姣",age:18,imgUrl: "../day05/痞帅暴富.jpg",friend:["泽宇小帅哥","黑娃"]};
            v.person = person;
        }
    }
})
</script>
</body>
</html>